/*
 * encoding.h
 * This file is part of gURL
 *
 * Copyright (C) 2013 - Aleksey Konovalov
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Library General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
#ifndef ENCODING_H
#define ENCODING_H

#include <gtk/gtk.h>

typedef enum {
    enc_ASCII,
    enc_UTF8,
    enc_UTF16,
    enc_UTF32,
    enc_CP1251,
    enc_CP866,
    enc_KOI8R,

    ENCODINGS_COUNT,
    UNKNOWN_ENCODING
} Encoding;

GString* decode_string(const gchar* input, gsize input_len, Encoding encoding);

Encoding determine_encoding_by_content_type(const GString* ct);

const char* get_encoding_name(Encoding enc);
Encoding get_encoding_by_name(const char* enc_name);

#endif /* ENCODING_H */
